package com.hzw.service.impl;

import com.hzw.config.DatabaseContextHolder;
import com.hzw.mapper.UsersMapper;
import com.hzw.model.Users;
import com.hzw.service.UsersService;
import com.hzw.util.DbUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户业务层接口实现类
 */
@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
    private UsersMapper usersMapper;

    @Override
    public List<Users> findUser() {
        // 指定数据源
        DatabaseContextHolder.setDBKey(DbUtil.DB_BASIC);
        return usersMapper.findUser();
    }
}
